﻿ 
@{ 
    Layout = "~/Views/Shared/_Index_Layout.cshtml";
}
<style type="text/css">
    .datagrid-btable .datagrid-cell { 
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }
</style>
<table id="DetailList"></table>

<script type="text/javascript">
    function FlowSTEPNOFormatter(value)
    { 
        var stepname = "";
        if(value == 0)
        {
            stepname = "起草";
        }
        else
        {
            stepname = "第" + value  + "步";
        }
        return stepname;
    }

    $(function () {
        $('#DetailList').datagrid({
            url: '/Flow/Form/GetFlowStepInfoList?id=@ViewBag.ID',
            toolbar: '#DetailListTools',
            width: SetGridWidthSub(54),
            methord: 'post',
            height:200,
            fitColumns: true,
            sortName: 'STEPNO',
            sortOrder: 'asc',
            idField: 'ID',
            pageSize: 15,
            pageList: [15, 20, 30, 40, 50],
            pagination: true,
            striped: true, //奇偶行是否区分
            singleSelect: true,//单选模式
            columns: [[
                 { field: 'STEPNO', title: '序号', width: 40, sortable: true, formatter: function (value, row) { return FlowSTEPNOFormatter(value) } },
                    { field: 'TITLE', title: '流程名称', width: 100, sortable: true },
                    { field: 'STEPNAME', title: '环节名称', width: 120, sortable: true },
                    { field: 'FORMLEVEL', title: '紧急程度', width: 80, sortable: true, hidden: true },
                    { field: 'CREATETIME', title: '流程开始时间', width: 80, sortable: true, hidden: true },
                    { field: 'TIMEOUT', title: '流程结束时间', width: 80, sortable: true, hidden: true },
                    { field: 'STARTUSERNAME', title: '起草人', width: 80, sortable: true, hidden: true },
                    { field: 'STEPSTATE', title: '环节状态', width: 50, sortable: true },
                    { field: 'TASKFINISHDATE', title: '下达时间', width: 90, sortable: true },
                    { field: 'USERNAME', title: '作业员', width: 60, sortable: true },
                    { field: 'CHECKTYPE', title: '处理方式', width: 50, sortable: true },
                    { field: 'REAMRK', title: '处理意见', width: 80, sortable: true },
                    { field: 'CHECKSTATE', title: '处理状态', width: 50, sortable: true },
                    //{ field: 'TASKFINISHDATE', title: '处理时间', width: 40, sortable: true, hidden: true },
                    { field: 'STEPCHECKID', title: 'STEPCHECKID', width: 80, sortable: true, hidden: true },
                    { field: 'STATEFLAG', title: 'STATEFLAG', width: 80, sortable: true, hidden: true },
                    { field: 'STARTUSERID', title: 'STARTUSERID', width: 80, sortable: true, hidden: true },
                    { field: 'ID', title: 'ID', width: 80, sortable: true, hidden: true },
                    { field: 'FORMID', title: 'FORMID', width: 80, sortable: true, hidden: true },
                    { field: 'USERID', title: 'USERID', width: 80, sortable: true, hidden: true },
                    { field: 'ATTRZ', title: 'ATTRZ', width: 80, sortable: true, hidden: true }
            ]]
        });
    });
</script>